Advanced Debugging
About AdvDbg Consult Train Services Products Tools Community Contact  
欢迎光临 高端调试 登录 | 注册 | FAQ
 
  ACPI调试
Linux内核调试
Windows内核调试
 
  调试战役
调试原理
新工具观察
 
  Linux
Windows Vista
Windows
 
  Linux驱动
WDF
WDM
 
  PCI Express
PCI/PCI-X
USB
无线通信协议
 
  64位CPU
ARM
IA-32
  CPU Info Center
 
  ACPI标准
系统认证
Desktop
服务器
 
  Embedded Linux
嵌入式开发工具
VxWorks
WinCE
嵌入式Windows
 
  格蠹调试套件(GDK)
  格蠹学院
  小朱书店
  老雷的微博
  《软件调试》
  《格蠹汇编》
  《软件调试(第二版)》
沪ICP备11027180号-1

Windows内核调试

帖子发起人: 卡尔   发起时间: 2013-12-17 23:51 下午   回复: 1

Print Search
帖子排序:    
   2013-12-17, 23:51 下午
linklock 离线,最后访问时间: 2013/12/17 15:42:33 卡尔

无等级
注册: 2013-12-17
发 贴: 1
没有Exception端口
Reply Quote
张老师您好,有幸拜读您的软件调试;遇到几个问题在此向您请教。
1.dt nt!_EPROCESS fffffa800f1f0880
2.我在本地内核调试执行伤处命令后,为什么我看不到书中提到的ExceptionPort呢?和操作系统有关吗?我的是win8
另外,uf kernel32!IsDebuggerPresent提示Couldn't resolve error at 'kernel32!IsDebuggerPresent;但是执行u ntdll!NtReadFile
就没有问题; 我已经reload了符号
3.第三个问题就是我按照书上说的执行了同样的命令,但是windbg显示的内容比书上少;如执行 k 命令,
0:003> k
Child-SP          RetAddr           Call Site
0000009c`494df9f8 000007fa`f6f2ade0 ntdll!DbgBreakPoint
0000009c`494dfa00 000007fa`f51f1832 ntdll!DbgUiRemoteBreakin+0x34
0000009c`494dfa30 000007fa`f6ecd609 KERNEL32!BaseThreadInitThunk+0x1a
0000009c`494dfa60 00000000`00000000 ntdll!RtlUserThreadStart+0x1d
在书上的235页




IP 地址: 已记录   报告
   2013-12-21, 14:52 下午
Raymond 离线,最后访问时间: 2020/7/3 3:40:25 格蠹老雷

发帖数前10位
注册: 2005-12-19
发 贴: 1,303
Re: 没有Exception端口
Reply Quote
1, 关于ExceptionPort,看了下Windows 8.1,是有一点变化,字段的名字变了,而且似乎有三个字段:
kd> dt _EPROCESS 8541b880 -ny Exception
ntdll!_EPROCESS
   +0x0e8 ExceptionPortData : 0x8343d3f0 Void
   +0x0e8 ExceptionPortValue : 0x8343d3f0
   +0x0e8 ExceptionPortState : 0y000
但从字段的偏移可以看出,显然是定义成一个Union

观察其中的值:
kd> !object 0x8343d3f0
Object: 8343d3f0  Type: (83497ea0) ALPC Port
    ObjectHeader: 8343d3d8 (new version)
    HandleCount: 1  PointerCount: 95
    Directory Object: 82564ad0  Name: ApiPort
 
仍然是ALPC端口,交给!alpc命令解析一下:
 
kd> !alpc /p 0x8343d3f0
Port  8343d3f0
  Type                      : ALPC_CONNECTION_PORT
  CommunicationInfo         : 8f0eb910
    ConnectionPort          : 8343d3f0 (ApiPort)
    ClientCommunicationPort : 00000000
    ServerCommunicationPort : 00000000
  OwnerProcess              : 84c57040 (csrss.exe)
  SequenceNo                : 0x0000072B (1835)
  CompletionPort            : 00000000
  CompletionList            : 00000000
  ConnectionPending         : No
  ConnectionRefused         : No
  Disconnected              : No
  Closed                    : No
  FlushOnClose              : Yes
  ReturnExtendedInfo        : No
  Waitable                  : No
  Security                  : Static
  Wow64CompletionList       : No
 
  2 thread(s) are waiting on the port:
 
    THREAD 834a4440  Cid 0164.018c  Teb: 7ff8c000 Win32Thread: 8c67da18 WAIT
    THREAD 834c5040  Cid 0164.01d4  Teb: 7ff8f000 Win32Thread: 8c67e650 WAIT
 
  Main queue is empty.
 
 
  Large message queue is empty.
 
 
  Pending queue is empty.
 
 
  Canceled queue is empty.

监听这个端口依然是csrss.exe进程,所以实质上没什么变化。

问题2,Win7做了一次DLL重构,本来在kernel32中的代码移入到了kernelbase,kernel32中做一个长跳转:
0:001> u kernel32!IsDebuggerPresent 
kernel32!IsDebuggerPresent:
75d44a04 ff25940dd475    jmp     dword ptr [kernel32!_imp__IsDebuggerPresent (75d40d94)]

0:001> u KERNELBASE!IsDebuggerPresent
KERNELBASE!IsDebuggerPresent:
74f3377c 64a118000000    mov     eax,dword ptr fs:[00000018h]
74f33782 8b4030          mov     eax,dword ptr [eax+30h]
74f33785 0fb64002        movzx   eax,byte ptr [eax+2]
74f33789 c3              ret

问题3,事物无时无刻不在运动变化着,花几分钟浏览下《周易》的简介...


IP 地址: 已记录   报告
高端调试 » 软件调试 » Windows内核调试 » 没有Exception端口

 
Legal Notice Privacy Statement Corporate Governance Corporate Governance
(C)2004-2020 ADVDBG.ORG All Rights Reserved.